package high.concurrent.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Redisson分布式锁配置
 */
@Configuration
public class RedissonLockConfig {

    @Bean
    public RedissonClient redissonClient(){

        Config config = new Config();

        // 单个redis配置
        config.useSingleServer().setAddress("redis://xx.xxx.xx.xxx:6379");
        return Redisson.create(config);
    }
}
